package com.info.widgets.Cv;
import java.util.ArrayList;
import java.util.List;
import java.sql.*;

import com.info.widgets.ConnectionHelper;
import com.info.widgets.DAOException;
import com.info.widgets.Cv.Cv;
public class CvService {
	public String cvCreation(Cv submit) throws DAOException{
		
		Cv submit1=new Cv();
		Connection con=null;
		String dbtime=null;
		//ArrayList<Cv> arrayList = new ArrayList<Cv>();
		String status="test";
		try{
			con=ConnectionHelper.getConnection();
			Statement stmt=con.createStatement();
			PreparedStatement pst = null;
			
			pst=con.prepareStatement("INSERT INTO myCaspian.submit_curriculam_vitae(first_name,last_name,current_job_title,current_location,email_id,contact_info,attach_resume,captcha_code,id) VALUES(?,?,?,?,?,?,?,?,?)");
			pst.setString(1,submit.getFirstName());
			pst.setString(2,submit.getLastName());
			pst.setString(3,submit.getCurrentjobtitle());
			pst.setString(4,submit.getCurrentjoblocation());
			pst.setString(5,submit.getEmailaddress());
			pst.setLong(6, submit.getContactinfo());
			pst.setString(7,submit.getAttachresume());
			pst.setLong(8,submit.getId());
		
			pst.executeUpdate();
			
		} catch (Exception e){
			e.printStackTrace();
			throw new DAOException(e);
			
		}finally {
			ConnectionHelper.close(con);
			
		}
		return status;
		
	}
	
}
	